#include "my_list.h"
#include"my_stack.h"
#include "my_queue.h"
#include <iostream>


void test1()
{
	my_list::list<int> lt;
	lt.push_back(1);
	lt.push_back(2);
	lt.push_back(3);
	lt.push_back(4);
	lt.push_back(5);
	lt.push_back(6);
	lt.push_back(7);

	lt.push_front(0);
	lt.push_front(0);

	lt.pop_back();
	lt.pop_front();

	my_list::list<int>::iterator it = lt.begin();
	while (it != lt.end())
	{
		std::cout << *it << " ";
		++it;
	}
	std::cout << std::endl;

	my_list::list<int> lt1;
	lt1 = lt;
	my_list::list<int>::iterator it1 = lt1.begin();
	while (it1 != lt1.end())
	{
		std::cout << *it1 << " ";
		++it1;
	}

	std::cout << std::endl;





}

void test2()
{
	my_stack::stack<int,std::list<int>> st;
	st.push(1);
	st.push(2);
	st.push(3);
	st.push(4);
	st.push(5);
	st.push(6);
	st.push(7);

	while (!st.empty())
	{
		std::cout << st.top() << " ";
		st.pop();
	}

}

void test3()
{
	my_queue::queue<int, std::list<int>> st;
	st.push(1);
	st.push(2);
	st.push(3);
	st.push(4);
	st.push(5);
	st.push(6);
	st.push(7);

	while (!st.empty())
	{
		std::cout << st.top() << " ";
		st.pop();
	}
}

void test4()
{
	my_list::list<int> lt;
	lt.push_back(1);
	lt.push_back(2);
	lt.push_back(3);
	lt.push_back(4);
	lt.push_back(5);
	lt.push_back(6);
	lt.push_back(7);

	my_list::list<int>::iterator it = lt.begin();
	while (it != lt.end())
	{
		std::cout << *it << " ";
		++it;
	}
	std::cout << std::endl;

	my_list::list<int>::reverse_iterator rit = lt.rbegin();
	while (rit != lt.rend())
	{
		std::cout << *rit << " ";
		++rit;
	}
	std::cout << std::endl;
}
int main()
{
	test4();
}